When inputting the correct input if statement doesn't work with DOM